package com.huawei.appmarket.framework.activity;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import androidx.annotation.Nullable;
import com.huawei.appgallery.foundation.ui.framework.uikit.ContractActivity;
import o.ayw;
import o.ayy;
import o.cfx;
import o.cjo;
import o.dfz;
import o.dgm;
import o.dky.b;
import o.dky.j;
import o.dyf;
import o.ActivityUtil;
import o.evk;

public class SecureActivity<T extends cjo> extends ContractActivity<T> {
    public void onCreate(@Nullable Bundle bundle) {
        ayy.ˋ().ˎ(getWindow());
        cfx.ˊ(dgm.ˎ((Activity) this));
        ayw.ॱ((Activity) this);
        super.onCreate(bundle);
    }

    public void onResume() {
        super.onResume();
        cfx.ˎ(dgm.ˎ((Activity) this));
    }

    public void onStop() {
        Object obj = null;
        super.onStop();
        if (ॱᐝ()) {
            Object obj2 = (ActivityUtil.ˋ(this) && ActivityUtil.ˏ((Context) this)) ? 1 : null;
            if (obj2 == null) {
                dfz.ˎ();
                new dyf().ˊ(dgm.ˎ((Activity) this));
                cfx.ॱ(dgm.ˎ((Activity) this), !ᐧ());
                if (ActivityUtil.ˏ()) {
                    String[] stringArray = getResources().getStringArray(b.ˎ);
                    if (ActivityUtil.ˋ(this, stringArray) || ActivityUtil.ॱ((Context) this, stringArray)) {
                        obj = 1;
                    }
                    if (obj == null) {
                        ᐝᐝ();
                    }
                }
            }
        }
    }

    protected void ᐝᐝ() {
        evk.ˏ(this, j.ʻᐝ, 0).ˋ();
    }

    public void onDestroy() {
        super.onDestroy();
        cfx.ˎ();
    }

    protected boolean ॱᐝ() {
        return true;
    }

    protected boolean ᐧ() {
        return false;
    }
}
